<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件


use PHPMailer\PHPMailer\PHPMailer;
function dump($data)
{
    print_r(json_encode($data));
}


function comment_array_to_count($array)
{
    return count($array);
}

function get_guid()
{
    return md5(rand() . time());
}

function email_to_code($email){
    return md5(sha1(md5(sha1($email))));
}

function process_resource_desc_of_htmldesc($content){
    $str= str_replace('"','',$content);
    $str=str_replace('<','',$str);
    $str=str_replace('>','',$str);
    return $str;
}

function get_baidupan_url_by_slice_panurl($pan){
    $arr=explode('-',$pan);
    return $arr[0];
}

function get_baidupan_pwd_by_slice_panurl($pan){
    $arr=explode('-',$pan);
    if(array_key_exists(1,$arr)){
        return $arr[1];
    }else return '';
}